/**
 * Copyright (C), 2019
 * FileName: CommonFrameFragment
 * Author: Administrator
 * Date: 2019/1/29 11:34
 * Description: 常用框架fragement
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
package com.example.demolearn_2.fragement;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.example.demolearn_2.R;
import com.example.demolearn_2.adapter.CommonFrameFragmentAdapter;
import com.example.demolearn_2.base.BaseFragment;


/**
 * @ClassName: CommonFrameFragment
 * @Description: java类作用描述
 * @Author: Administrator
 * @Date: 2019/1/29 11:34
 */
public class OtherFragment extends BaseFragment {

    private TextView title;
    private CommonFrameFragmentAdapter mAdatpter;
    private ListView mListView;
    private String[] mDataList;

    @Override
    protected View initView() {
        Log.e(OtherFragment.class.getSimpleName(),"其他CommonFrameFragment被初始化了");
        View view = View.inflate(mContext, R.layout.fragment_demo, null);
        mListView = (ListView) view.findViewById(R.id.lv_list);
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//                String data = mDataList[position];
//                if (data.toLowerCase().equals("沉浸时状态栏")) {
//                    Intent intent = new Intent(mContext, BaiDuActivity.class);
//                    mContext.startActivity(intent);
//                }
//                // 点击位置的显示
//                Toast.makeText(mContext, "data==" + data, Toast.LENGTH_SHORT).show();
            }
        });

        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    @Override
    protected void initData(){
        mDataList = new String[]{"百度地图"};

        mAdatpter = new CommonFrameFragmentAdapter(mContext,mDataList);
        mListView.setAdapter(mAdatpter);
    }

}
